package com.jl.card.parse.part;

import com.jl.card.parse.IAPDUComponent;
import com.jl.card.parse.StatusWordTable;
import com.jl.util.HexUtil;

public class SWPart extends APDUPart{

	private StringBuilder res = new StringBuilder("SW   :"); 
	private int sw;
	public SWPart(IAPDUComponent parent, byte[] part) {
		super(parent, part);
		res.append(HexUtil.toHexCompact(part, 0, 2));
		sw = HexUtil.makeInt(part, 0, 2);
		analyse();
	}

	@Override
	public String getSummary() {
		return res.toString();
	}

	@Override
	public void analyse() {
		res.append('[');
		res.append(StatusWordTable.StringForSW(sw));
		res.append(']');
	}
	
}
